Skip to main content

Linear Transformations

Linear transformations are the bread and butter of linear algebra. They are functions that map vectors to vectors in a way that preserves the structure of the vector space. In this section, we will explore the properties of linear transformations and how they can be represented using matrices.

Table of Contents

Thinking about Transformations

For the purposes of this section, we will not consider the formal definition of a linear transformation, because that will hinder our understanding. Instead, we will approach this from a more intuitive perspective.

The term "linear transformation" has two parts: "linear" and "transformation". We will first focus on what a transformation is, and then we will discuss what it means for a transformation to be linear.

A transformation is essentially just a function; it takes an input and produces an output. These terms are used interchangeably in this context, but by convention, we use "transformation" here. The difference between a function that one would typically encounter and a linear transformation is that these transformations act on vectors.

A function can be notated like , where is the input. Likewise, a transformation can be notated like , where is the input vector.

Just like functions, transformations have various components that define them, such as their domain, codomain, and image. For the sake of simplicity, we won't delve into these details, but it's important to keep in mind that there is a formal underpinning to these concepts.

Visualizing a Transformation

One way to conceptualize a transformation is that they take a vector and move it to a different location in space. Below is a visualization of a transformation that takes a vector and moves it to a new location .

Doing this for multiple vectors will give us a sense of how the transformation behaves on the entire space:

Next, we can replace each vector with a point to make things clearer.

Sometimes, it's beneficial to visualize the transformation acting on not a set of vectors, but the grid itself:

What Makes a Transformation Linear?

There is a formal definition of what it means for a transformation to be linear based on two properties that it must satisfy (additivity and homogeneity). Graphically, these properties correspond to the transformation preserving the structure of the space.

Intuitively, a transformation is linear if it doesn't twist or distort the space. That is, every line remains a line after the transformation, and the origin remains fixed at .

In the visualization below, the left side shows a linear transformation, and the right side shows a non-linear transformation.

Here's another example. Initially, this looks like a linear transformation, but it's not:

From this visualization, the lines remain lines and the origin remains fixed, so it seems like a linear transformation. However, this is just because we drew some lines, not all of them. If we draw a diagonal line, we can see that the transformation twists the line:

In order to account for all lines in the space, we need to add another condition: that the gridlines remain parallel and evenly spaced.

Putting everything together, we can say that:

A transformation is linear if it satisfies the following properties when acting on the space:

  1. Every line remains a line.
  2. The origin remains fixed at .
  3. The gridlines remain parallel and evenly spaced.

In linear algebra, we often restrict our attention to linear transformations because they are easier to work with and have nice properties that we can exploit. After all, linear transformations and linear algebra share the term "linear" for a reason.

Representing Linear Transformations

Recall that a linear transformation is a function that maps vectors to vectors in a way that preserves the structure of the vector space. We deduced that gridlines must remain parallel and evenly spaced for a transformation to be linear.

A consequence of this is that we can describe a linear transformation by specifying where it sends the basis vectors.

Consider a vector . As previously mentioned, is a linear combination of the basis vectors and with the coefficients and respectively.

When we transform the basis vectors and into new vectors and , we can express as a linear combination of and , but with the same coefficients and . This is best illustrated with a diagram.

First, let's visualize the basis vectors and and how they are transformed by a linear transformation :

In our transformation, is sent to and is sent to .

Let's add our vector to the visualization:

Notice that before the transformation, can be expressed as two vectors and one vector. After the transformation, can still be expressed as two vectors and one vector.

If we write it out mathematically, we have:

Essentially, when transforming a vector, we replace the basis vectors with their transformed counterparts and keep the coefficients the same.

In a more general case, suppose the vector is . Then:

Introducing The Matrix

To sum up the previous section, we can represent a linear transformation by specifying where it sends the basis vectors.

We looked at an example where was sent to and was sent to . It is often convenient to represent these vectors as columns in a grid, known as a matrix:

This matrix has two columns, one representing the transformed and the other representing the transformed .

If we were to apply this transformation to a vector , we would apply each column of the matrix to the corresponding component of :

When we apply the transformation to a vector, we often place the matrix in front of the vector in a matrix-vector product:

Finally, let's generalize this process. Given a matrix and a vector , the matrix-vector product is:

The last equation is the general form of a matrix-vector product. Let's write it again for emphasis:

Geometric Transformations

In the previous section, we discussed how linear transformations can be represented by matrices. Let's explore some common geometric transformations and how they can be represented using matrices.

Remember that the matrix represents a transformation that sends to and to .

Scaling

A scaling transformation stretches or compresses the space along the axes. For example, consider a scaling transformation that stretches the -axis by a factor of and compresses the -axis by a factor of .

Looking at where it takes the basis vectors, we have:

The visualization below shows how this transformation acts on the space:

In a more general case, a scaling transformation that stretches the -axis by a factor of and the -axis by a factor of can be represented by the matrix:

If any of the factors are negative, the space is reflected across the corresponding axis.

Rotation

A rotation transformation rotates the space by a certain angle. For example, consider a rotation transformation that rotates the space by counterclockwise.

This one is a bit trickier to write, so let's draw it out first. The diagram below shows the basis vectors and and how they are rotated by an angle :

Looking at where it takes the basis vectors, we have:

Notice that the rotated vector takes a negative sign in front of the term.

Shearing

A shearing transformation skews the space along the axes. When this happens, one of the basis vectors remains fixed, and the other is shifted along the fixed vector.

For example, consider a shearing transformation that shifts the -axis by a factor of along the -axis.

A visualization of this transformation is shown below:

Looking at where it takes the basis vectors, we have:

More generally, a shearing transformation that shifts the -axis by a factor of along the -axis can be represented by the matrix:

No Transformation (Identity Matrix)

Finally, let's consider a transformation that doesn't do anything.

In terms of the basis vectors, this transformation sends to and to . In other words, the basis vectors remain fixed. As such, the matrix representing this transformation can be written as:

This matrix has a special name: the identity matrix, and it is often denoted by . Since this is in two dimensions, we can also add a subscript to denote the dimensionality:

This can be generalized to higher dimensions by simply adding more rows and columns of 's along the diagonal:

Summary and Next Steps

In this section, we introduced the fundamental concept of linear transformations and how they can be represented using matrices.

Here are the key points to remember:

  • A linear transformation is a function that maps vectors to vectors in a way that preserves the structure of the vector space.

  • Linear transformations have the visual property that every line remains a line, the origin remains fixed, and the gridlines remain parallel and evenly spaced.

  • Linear transformations can be represented by specifying where they send the basis vectors.

  • These specifications can be organized into a matrix, which can be used to transform vectors using matrix-vector multiplication:

  • Common geometric transformations like scaling, rotation, and shearing can be represented by specific matrices:

    • Scaling:
    • Rotation:
    • Shearing:
    • Identity:
  • The identity matrix represents a transformation that doesn't do anything.

In the next section, we will explore how linear transformations can be composed and inverted, which will allow us to build more complex transformations from simpler ones.